A factory reset function of a communications device is relatively common. When a user makes an incorrect setting or forgets a user name or a password and cannot log in to a device, the user may use a factory reset function, to start the device by using a default factory setting, and then log in to the device by using an initial user name and password. In consideration of factors such as panel space and costs, usually, no dedicated button is used to implement the factory reset function. Instead, a reset (RESET) button is used to assist in implementing the factory reset function. For example, the reset button generates a pressing signal when being pressed, and a complex programmable logical device (CPLD) is used to detect duration of consecutive pressing signals. If the CPLD detects that the duration of the consecutive pressing signals is greater than a preset value, factory reset is performed. If the duration of the consecutive pressing signals is less than a preset value, a system is only reset.
When the factory reset is implemented in this manner, the CPLD or a similar related hardware circuit is required to implement timing and detection functions. Costs of such hardware circuit are relatively high, and software complexity is relatively high. Therefore, production and research and development costs of the communications device are increased.